import config from 'config'
import httpFetch from 'share/httpFetch'
import errorMessage from "share/errorMessage";

export default {
  //获取问题分类列表
  getCategoryList (categoryType, language) {
    return httpFetch.unsafe.get(`${config.baseUrl}/api/commonproblem/search?userType=user&categoryType=${categoryType}&language=${language}`)
      .catch(err => {
        errorMessage(err.response);
        throw err;
      })
  },

  //根据问题分类类型获取问题列表
  getQuesList (categoryType, language) {
    return httpFetch.unsafe.get(`${config.baseUrl}/api/commonproblem?categoryType=${categoryType}&language=${language}`)
      .catch(err => {
        errorMessage(err.response);
        throw err;
      })
  },
}
